package main;

import main.test.SimpleHttpHandler;
import main.tcp.EchoApp;
import main.tcp.NioTcpServer;

import main.http.HttpHandler;
import java.io.IOException;

public class Manager {

	public static void main(String[] args) throws IOException {
		startHttpServer();
	}

	public static void startEchoServer() throws IOException{
		NioTcpServer server = new NioTcpServer(5000);
		EchoApp app = new EchoApp();
		Thread thread = new Thread(server);

		app.setServer(server);
		server.setAppClass(app.getClass());

		thread.start();
	}

	public static void startHttpServer() throws IOException{
		NioTcpServer server = new NioTcpServer(5001);
		HttpHandler app = new SimpleHttpHandler();
		Thread thread = new Thread(server);

		app.setServer(server);
		server.setAppClass(app.getClass());

		thread.start();
	}
}
